home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1184 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  975 b 

  1. From: mk@anuurn.do.open.de (Martin Koehling)
  2. Subject: Re: load average patches for MiNT 1.10 + patches
  3. Date: Thu, 10 Mar 1994 20:25:14 MEZ
  4. Mime-Version: 1.0
  5.  
  6. Hi Juergen,
  7.  
  8. >michael smith writes:
  9. >>  but I don't believe in that sort
  10. >> of ceiling regardless of how it's implemented, and someone is _bound_ to harp
  11. >> on it.)
  12. >
  13. > true.  thats also why you should always do timeouts checks like this
  14. >
  15. >    unsigned tick = timer counter (like _hz_200) + time to wait;
  16. >    for (...)
  17. >        if (timer counter - tick > 0)  break;
  18. >
  19. >instead of
  20. >    ...
  21. >        if (timer counter > tick)  break;
  22. >
  23. >(and any compiler that `optimizes' the difference away should be shot. :)
  24.  
  25. I don't quite see the difference between these two checks - they _both_
  26. will come into trouble if `counter + time to wait' exceeds the value range
  27. of `unsigned'!
  28. The only *real* solution I can see is expanding the timer to a `long
  29. long'...
  30.  
  31. Martin
  32. -- 
  33.  Martin Koehling | mk@anuurn.do.open.de | Martin_Koehling@un.maus.ruhr.de
  34.